<?php

abstract class Singleton {
	private static $instances = Array();

	abstract protected function __construct();

	public static function getInstance($c) {
		if (!isset(Singleton::$instances[$c])) {
			Singleton::$instances[$c] = new $c;
		}
		return Singleton::$instances[$c];
	}

	public function __clone() {
		throw new coreException('Singletone clonning is not permitted. Just becase it\'s non-sense.');
	}


}